package com.gupaoedu.pattern.observer.guava;

import com.google.common.eventbus.Subscribe;
import com.gupaoedu.pattern.observer.gper.Question;


/**
 * 2019/9/28
 * created by chenpp
 */
public class GuavaTeacher {

    private String name;

    public GuavaTeacher(String name){
        this.name = name;
    }
    //使用注解完成监听
    @Subscribe
    public void listen(Question question){
        System.out.println("=========================================");
        System.out.println(this.name+"老师,你收到了学员"+question.getName()+"的一个问题，\n"
                +"内容为:"+question.getContent());
    }
}
